class Solution:
    def findRepeatNumber(self, nums: List[int]) -> int:
        n=len(nums)
        for i in range(n):           
            while nums[i]!=i:
                if(nums[i]==nums[nums[i]]):
                    return nums[i]
                tem=nums[i]
                nums[i]=nums[tem]
                nums[tem]=tem
        return -1